package com.turing.post.cardmanagement.util;

import java.io.Serializable;
import java.math.BigInteger;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
/**
 * 调拨单明细
 * @author ys
 * @date 2012-12-17
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "TransferInOutStockOrderDetail")
@IdClass(TransferInOutStockOrderDetail.class)
public class TransferInOutStockOrderDetail implements Serializable {
	
	public TransferInOutStockOrderDetail(){
		super();
	}
	/**
	 * 调整单ID
	 */
	private BigInteger transferInOutStockOrderId;
	/**
	 * 单内序号
	 */
	private Integer orderItemSeqNo;
	/**
	 * 制卡批次号
	 */
	private String batchNo;
	/**
	 * 起始序号
	 */
	private String cardStartSeqNo;
	/**
	 * 终止序号
	 */
	private String cardEndSeqNo;
	/**
	 * 起始卡号
	 */
	private String startCardNo;
	/**
	 * 终止卡号
	 */
	private String endCardNo;
	/**
	 * 发生张数
	 */
	private Integer orderCount;
	/**
	 * 备注
	 */
	private String remark;
	
	@Id
	@Column(name = "TRANSFERINOUTSTOCKORDERID", nullable = false)
	public BigInteger getTransferInOutStockOrderId() {
		return transferInOutStockOrderId;
	}
	public void setTransferInOutStockOrderId(BigInteger transferInOutStockOrderId) {
		this.transferInOutStockOrderId = transferInOutStockOrderId;
	}
	
	@Id
	@Column(name = "ORDERITEMSEQNO", nullable = false)
	public Integer getOrderItemSeqNo() {
		return orderItemSeqNo;
	}
	public void setOrderItemSeqNo(Integer orderItemSeqNo) {
		this.orderItemSeqNo = orderItemSeqNo;
	}
	
	@Column(name = "BATCHNO", nullable = false)
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	
	@Column(name = "CARDSTARTSEQNO", nullable = false)
	public String getCardStartSeqNo() {
		return cardStartSeqNo;
	}
	public void setCardStartSeqNo(String cardStartSeqNo) {
		this.cardStartSeqNo = cardStartSeqNo;
	}
	
	@Column(name = "CARDENDSEQNO", nullable = false)
	public String getCardEndSeqNo() {
		return cardEndSeqNo;
	}
	public void setCardEndSeqNo(String cardEndSeqNo) {
		this.cardEndSeqNo = cardEndSeqNo;
	}
	
	@Column(name = "STARTCARDNO", nullable = false)
	public String getStartCardNo() {
		return startCardNo;
	}
	public void setStartCardNo(String startCardNo) {
		this.startCardNo = startCardNo;
	}
	
	@Column(name = "ENDCARDNO", nullable = false)
	public String getEndCardNo() {
		return endCardNo;
	}
	public void setEndCardNo(String endCardNo) {
		this.endCardNo = endCardNo;
	}
	
	@Column(name = "ORDERCOUNT", nullable = false)
	public Integer getOrderCount() {
		return orderCount;
	}
	public void setOrderCount(Integer orderCount) {
		this.orderCount = orderCount;
	}
	
	@Column(name = "REMARK", nullable = true)
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((getOrderItemSeqNo()== null) ? 0 : getOrderItemSeqNo().hashCode());
		result = prime
				* result
				+ ((getTransferInOutStockOrderId() == null) ? 0
						: getTransferInOutStockOrderId().hashCode());
		return result;
	}
	
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TransferInOutStockOrderDetail other = (TransferInOutStockOrderDetail) obj;
		if (getOrderItemSeqNo() == null) {
			if (other.getOrderItemSeqNo() != null)
				return false;
		} else if (!getOrderItemSeqNo().equals(other.getOrderItemSeqNo()))
			return false;
		if (getTransferInOutStockOrderId() == null) {
			if (other.getTransferInOutStockOrderId() != null)
				return false;
		} else if (!getTransferInOutStockOrderId()
				.equals(other.getTransferInOutStockOrderId()))
			return false;
		return true;
	}
	
	
}
